extend ../layout 

block content
	.container 
		.row
			each cat in catgories
				.panel.panel-default
					.panel-heading
						h3 
							a(href="/results?cat=#{cat._id}&p=1") #{cat.name}
					.panel-body
						if cat.movies && cat.movies.length > 0
							each item in cat.movies
								.col-md-2
									.thumbnail.text-center
										a(href="/movie/#{item._id}")
											if item.poster.indexOf('http:') > -1 || item.poster.indexOf('https:') > -1
												img(src="#{item.poster}", alt="#{item.title}", srcset="")
											else 
												img(src="/upload/#{item.poster}", alt="#{item.title}", srcset="")
										.caption
											h3.text-ellipsis #{item.title}
											p: a.btn.btn-primary(href="/movie/#{item._id}" ,role="button") 观看预告片
						else
							.text-center
								img(src="/images/data-null.png", alt="没有数据", srcset="" style="width:80px;margin:30px 0;") 
								p(style="margin:30px 0;") 本栏目还没有电影,赶快去
									a(href="/admin/movie/new")上传
									一个吧